#include "lxz_config.h"

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*  */

#ifdef LXZAT_WIN32
#include <io.h>
#include <windows.h>
#endif /* LXZAT_WIN32 */

#ifdef LXZAT_LINUX
#include <unistd.h>
#endif /* LXZAT_LINUX */

#include "lxz_types.h"
#include "os_port.h"
#include "lxz_version.h"
#include "lxz_runlog.h"
#include "lxz_debug.h"
#include "lxz_ring.h"
#include "lxz_string.h"
#include "lxz_dstring.h"
#include "lxz_atc_req.h"
#include "lxz_inner_cmd.h"
#include "lxz_dbg_vmem.h"

static sint32 lxzat_dollar_mydbgtime_req(void * pctxt);
static sint32 lxzat_dollar_mydbgtime_resp(void * pctxt);

static sint32 lxzat_dollar_mydbgdate_req(void * pctxt);
static sint32 lxzat_dollar_mydbgdate_resp(void * pctxt);

static sint32 lxzat_dollar_mydbgauthor_req(void * pctxt);
static sint32 lxzat_dollar_mydbgauthor_resp(void * pctxt);

static sint32 lxzat_dollar_myhwver_req(void * pctxt);
static sint32 lxzat_dollar_myhwver_resp(void * pctxt);

static sint32 lxzat_dollar_myswver_req(void * pctxt);
static sint32 lxzat_dollar_myswver_resp(void * pctxt);

static sint32 lxzat_dollar_mydbgatlist_req(void * pctxt);
static sint32 lxzat_dollar_mydbgatlist_resp(void * pctxt);

static sint32 lxzat_dollar_mysystemcfg_init(void * pctxt);
static sint32 lxzat_dollar_mysystemcfg_req(void * pctxt);
static sint32 lxzat_dollar_mysystemcfg_resp(void * pctxt);
static sint32 lxzat_dollar_mysystemcfg_reset(void * pctxt);

static sint32 lxzat_dollar_mytypemask_init(void * pctxt);
static sint32 lxzat_dollar_mytypemask_req(void * pctxt);
static sint32 lxzat_dollar_mytypemask_resp(void * pctxt);
static sint32 lxzat_dollar_mytypemask_reset(void * pctxt);

static sint32 lxzat_dollar_mycimi_init(void * pctxt);
static sint32 lxzat_dollar_mycimi_req(void * pctxt);
static sint32 lxzat_dollar_mycimi_resp(void * pctxt);
static sint32 lxzat_dollar_mycimi_reset(void * pctxt);

static sint32 lxzat_dollar_mycgsn_init(void * pctxt);
static sint32 lxzat_dollar_mycgsn_req(void * pctxt);
static sint32 lxzat_dollar_mycgsn_resp(void * pctxt);
static sint32 lxzat_dollar_mycgsn_reset(void * pctxt);

static sint32 lxzat_dollar_mycgmi_init(void * pctxt);
static sint32 lxzat_dollar_mycgmi_req(void * pctxt);
static sint32 lxzat_dollar_mycgmi_resp(void * pctxt);
static sint32 lxzat_dollar_mycgmi_reset(void * pctxt);

static sint32 lxzat_dollar_mycgmm_init(void * pctxt);
static sint32 lxzat_dollar_mycgmm_req(void * pctxt);
static sint32 lxzat_dollar_mycgmm_resp(void * pctxt);
static sint32 lxzat_dollar_mycgmm_reset(void * pctxt);

static sint32 lxzat_dollar_mycgmr_init(void * pctxt);
static sint32 lxzat_dollar_mycgmr_req(void * pctxt);
static sint32 lxzat_dollar_mycgmr_resp(void * pctxt);
static sint32 lxzat_dollar_mycgmr_reset(void * pctxt);

/* Detail: 0:CSPG;1:SGCC. */
static sint32 gs_cur_startmode = 0;

/* Detail: 1:2G-GPRS;5:4G-5RAT;7:4G-7RAT. */
static sint32 gs_cur_typemask = LXZAT_DEF_TYPE_MASK;

/*
 *  Description:
 *    A caplets for hiding concrete implementation.
 *  Note: 
 *    Please do not change any part of current piece when you unsure.
 */
const lxzat_info_t lai_dollar_mydbgtime =
{
    LXZAT_TYPE_RANGE_LOCAL|LXZAT_TYPE_STRING_EXTEND,
    "$MYDBGTIME", 
    NULL,
    lxzat_dollar_mydbgtime_req,
    lxzat_dollar_mydbgtime_resp,
    NULL
};

/*
 *  Description:
 *    A caplets for hiding concrete implementation.
 *  Note: 
 *    Please do not change any part of current piece when you unsure.
 */
const lxzat_info_t lai_dollar_mydbgdate =
{
    LXZAT_TYPE_RANGE_LOCAL|LXZAT_TYPE_STRING_EXTEND,
    "$MYDBGDATE", 
    NULL,
    lxzat_dollar_mydbgdate_req,
    lxzat_dollar_mydbgdate_resp,
    NULL
};

/*
 *  Description:
 *    A caplets for hiding concrete implementation.
 *  Note: 
 *    Please do not change any part of current piece when you unsure.
 */
const lxzat_info_t lai_dollar_mydbgauthor =
{
    LXZAT_TYPE_RANGE_LOCAL|LXZAT_TYPE_STRING_EXTEND,
    "$MYDBGAUTHOR", 
    NULL,
    lxzat_dollar_mydbgauthor_req,
    lxzat_dollar_mydbgauthor_resp,
    NULL
};

/*
 *  Description:
 *    A caplets for hiding concrete implementation.
 *  Note: 
 *    Please do not change any part of current piece when you unsure.
 */
const lxzat_info_t lai_dollar_myhwver =
{
    LXZAT_TYPE_RANGE_LOCAL|LXZAT_TYPE_STRING_EXTEND,
    "$MYHWVER", 
    NULL,
    lxzat_dollar_myhwver_req,
    lxzat_dollar_myhwver_resp,
    NULL
};

/*
 *  Description:
 *    A caplets for hiding concrete implementation.
 *  Note: 
 *    Please do not change any part of current piece when you unsure.
 */
const lxzat_info_t lai_dollar_myswver =
{
    LXZAT_TYPE_RANGE_LOCAL|LXZAT_TYPE_STRING_EXTEND,
    "$MYSWVER", 
    NULL,
    lxzat_dollar_myswver_req,
    lxzat_dollar_myswver_resp,
    NULL
};

/*
 *  Description:
 *    A caplets for hiding concrete implementation.
 *  Note: 
 *    Please do not change any part of current piece when you unsure.
 */
const lxzat_info_t lai_dollar_mydbgatlist =
{
    LXZAT_TYPE_RANGE_LOCAL|LXZAT_TYPE_STRING_EXTEND,
    "$MYDBGATLIST", 
    NULL,
    lxzat_dollar_mydbgatlist_req,
    lxzat_dollar_mydbgatlist_resp,
    NULL
};

/*
 *  Description:
 *    A caplets for hiding concrete implementation.
 *  Note: 
 *    Please do not change any part of current piece when you unsure.
 */
const lxzat_info_t lai_dollar_mysystemcfg =
{
    LXZAT_TYPE_RANGE_LOCAL|LXZAT_TYPE_STRING_BASIC,
    "$MYSYSTEMCFG", 
    lxzat_dollar_mysystemcfg_init,
    lxzat_dollar_mysystemcfg_req,
    lxzat_dollar_mysystemcfg_resp,
    lxzat_dollar_mysystemcfg_reset
};

/*
 *  Description:
 *    A caplets for hiding concrete implementation.
 *  Note: 
 *    Please do not change any part of current piece when you unsure.
 */
const lxzat_info_t lai_dollar_mytypemask =
{
    LXZAT_TYPE_RANGE_LOCAL|LXZAT_TYPE_STRING_BASIC,
    "$MYTYPEMASK", 
    lxzat_dollar_mytypemask_init,
    lxzat_dollar_mytypemask_req,
    lxzat_dollar_mytypemask_resp,
    lxzat_dollar_mytypemask_reset
};

/*
 *  Description:
 *    A caplets for hiding concrete implementation.
 *  Note: 
 *    Please do not change any part of current piece when you unsure.
 */
const lxzat_info_t lai_dollar_mycimi =
{
    LXZAT_TYPE_RANGE_LOCAL|LXZAT_TYPE_STRING_BASIC,
    "$MYCIMI", 
    lxzat_dollar_mycimi_init,
    lxzat_dollar_mycimi_req,
    lxzat_dollar_mycimi_resp,
    lxzat_dollar_mycimi_reset
};

/*
 *  Description:
 *    A caplets for hiding concrete implementation.
 *  Note: 
 *    Please do not change any part of current piece when you unsure.
 */
const lxzat_info_t lai_dollar_mycgsn =
{
    LXZAT_TYPE_RANGE_LOCAL|LXZAT_TYPE_STRING_BASIC,
    "$MYCGSN", 
    lxzat_dollar_mycgsn_init,
    lxzat_dollar_mycgsn_req,
    lxzat_dollar_mycgsn_resp,
    lxzat_dollar_mycgsn_reset
};

/*
 *  Description:
 *    A caplets for hiding concrete implementation.
 *  Note: 
 *    Please do not change any part of current piece when you unsure.
 */
const lxzat_info_t lai_dollar_mycgmi =
{
    LXZAT_TYPE_RANGE_LOCAL|LXZAT_TYPE_STRING_BASIC,
    "$MYCGMI", 
    lxzat_dollar_mycgmi_init,
    lxzat_dollar_mycgmi_req,
    lxzat_dollar_mycgmi_resp,
    lxzat_dollar_mycgmi_reset
};

/*
 *  Description:
 *    A caplets for hiding concrete implementation.
 *  Note: 
 *    Please do not change any part of current piece when you unsure.
 */
const lxzat_info_t lai_dollar_mycgmm =
{
    LXZAT_TYPE_RANGE_LOCAL|LXZAT_TYPE_STRING_BASIC,
    "$MYCGMM", 
    lxzat_dollar_mycgmm_init,
    lxzat_dollar_mycgmm_req,
    lxzat_dollar_mycgmm_resp,
    lxzat_dollar_mycgmm_reset
};

/*
 *  Description:
 *    A caplets for hiding concrete implementation.
 *  Note: 
 *    Please do not change any part of current piece when you unsure.
 */
const lxzat_info_t lai_dollar_mycgmr =
{
    LXZAT_TYPE_RANGE_LOCAL|LXZAT_TYPE_STRING_BASIC,
    "$MYCGMR", 
    lxzat_dollar_mycgmr_init,
    lxzat_dollar_mycgmr_req,
    lxzat_dollar_mycgmr_resp,
    lxzat_dollar_mycgmr_reset
};

/*
 *  Description:
 *    The request handler of "AT$MYDBGTIME".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mydbgtime_req(void * pctxt)
{
    return E_LEC_OK;
}

/*
 *  Description:
 *    The response handler of "AT$MYDBGTIME".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mydbgtime_resp(void * pctxt)
{
    LXZAT_ERROR_CODE_E e_err_code = E_LEC_OK;

    sint32 i_req_type = LXZAT_REQ_TYPE_ERR;
    lxzat_req_t * p_cur_req = NULL;
    lxzat_spcfg_t * p_cur_spcfg = NULL;
    lxzdata_info_t * p_cur_datacfg = NULL;
    lxzat_context_t * p_lxzat_ctxt = (lxzat_context_t *)pctxt;

    if (p_lxzat_ctxt == NULL)
    {
        OS_DBG_LOG(("lxzat_dollar_mydbgtime_resp,p_lxzat_ctxt is NULL!\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }

    p_cur_req = p_lxzat_ctxt->pt_req_data;
    p_cur_spcfg = lxzat_spcomm_f_get(p_lxzat_ctxt->it_vsp_id);
    if ((p_cur_req == NULL) || (p_cur_spcfg == NULL))
    {
        OS_DBG_LOG(("lxzat_dollar_mydbgtime_resp,p_cur_req or p_cur_spcfg is NULL!\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }

    i_req_type = p_cur_req->it_req_type;
    switch (i_req_type)
    {
    case LXZAT_REQ_TYPE_EXE:
    case LXZAT_REQ_TYPE_READ:
        {
            lxzat_rsp_f_printf(p_lxzat_ctxt->it_vsp_id, 
                LXZAT_RSP_MODE_P1N0, 
                "%s: \"%s-%s\"", 
                p_lxzat_ctxt->pt_ai_cfg->pt_ai_keyword,
                LXZAT_SW_BUILD_DATE,
                LXZAT_SW_BUILD_TIME);
            break;
        }
    default:
        {
            e_err_code = E_LEC_ERR_UNSUPPORTED;
            break;
        }
    }
    
    return e_err_code;
}

/*
 *  Description:
 *    The request handler of "AT$MYDBGDATE".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mydbgdate_req(void * pctxt)
{
    return E_LEC_OK;
}

/*
 *  Description:
 *    The response handler of "AT$MYDBGDATE".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mydbgdate_resp(void * pctxt)
{
    LXZAT_ERROR_CODE_E e_err_code = E_LEC_OK;

    sint32 i_req_type = LXZAT_REQ_TYPE_ERR;
    lxzat_req_t * p_cur_req = NULL;
    lxzat_spcfg_t * p_cur_spcfg = NULL;
    lxzdata_info_t * p_cur_datacfg = NULL;
    lxzat_context_t * p_lxzat_ctxt = (lxzat_context_t *)pctxt;

    if (p_lxzat_ctxt == NULL)
    {
        OS_DBG_LOG(("lxzat_dollar_mydbgdate_resp,p_lxzat_ctxt is NULL!\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }

    p_cur_req = p_lxzat_ctxt->pt_req_data;
    p_cur_spcfg = lxzat_spcomm_f_get(p_lxzat_ctxt->it_vsp_id);
    if ((p_cur_req == NULL) || (p_cur_spcfg == NULL))
    {
        OS_DBG_LOG(("lxzat_dollar_mydbgdate_resp,p_cur_req or p_cur_spcfg is NULL!\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }

    i_req_type = p_cur_req->it_req_type;
    switch (i_req_type)
    {
    case LXZAT_REQ_TYPE_EXE:
    case LXZAT_REQ_TYPE_READ:
        {
            lxzat_rsp_f_printf(p_lxzat_ctxt->it_vsp_id,
                LXZAT_RSP_MODE_P1N0, 
                "%s: \"%s\"", 
                p_lxzat_ctxt->pt_ai_cfg->pt_ai_keyword,
                LXZAT_SW_BUILD_DATE);
            break;
        }
    default:
        {
            e_err_code = E_LEC_ERR_UNSUPPORTED;
            break;
        }
    }
    
    return e_err_code;
}

/*
 *  Description:
 *    The request handler of "AT$MYDBGAUTHOR".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mydbgauthor_req(void * pctxt)
{
    return E_LEC_OK;
}

/*
 *  Description:
 *    The response handler of "AT$MYDBGAUTHOR".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mydbgauthor_resp(void * pctxt)
{
    LXZAT_ERROR_CODE_E e_err_code = E_LEC_OK;

    sint32 i_req_type = LXZAT_REQ_TYPE_ERR;
    lxzat_req_t * p_cur_req = NULL;
    lxzat_spcfg_t * p_cur_spcfg = NULL;
    lxzdata_info_t * p_cur_datacfg = NULL;
    lxzat_context_t * p_lxzat_ctxt = (lxzat_context_t *)pctxt;

    if (p_lxzat_ctxt == NULL)
    {
        OS_DBG_LOG(("lxzat_dollar_mydbgauthor_resp,p_lxzat_ctxt is NULL!\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }

    p_cur_req = p_lxzat_ctxt->pt_req_data;
    p_cur_spcfg = lxzat_spcomm_f_get(p_lxzat_ctxt->it_vsp_id);
    if ((p_cur_req == NULL) || (p_cur_spcfg == NULL))
    {
        OS_DBG_LOG(("lxzat_dollar_mydbgauthor_resp,p_cur_req or p_cur_spcfg is NULL!\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }

    i_req_type = p_cur_req->it_req_type;
    switch (i_req_type)
    {
    case LXZAT_REQ_TYPE_EXE:
    case LXZAT_REQ_TYPE_READ:
        {
            lxzat_rsp_f_printf(p_lxzat_ctxt->it_vsp_id,
                LXZAT_RSP_MODE_P1N0, 
                "%s: \"%s\"", 
                p_lxzat_ctxt->pt_ai_cfg->pt_ai_keyword,
                "tangtao1170@163.com");
            break;
        }
    default:
        {
            e_err_code = E_LEC_ERR_UNSUPPORTED;
            break;
        }
    }
    
    return e_err_code;
}

/*
 *  Description:
 *    The request handler of "AT$MYHWVER".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_myhwver_req(void * pctxt)
{
    return E_LEC_OK;
}

/*
 *  Description:
 *    The response handler of "AT$MYHWVER".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_myhwver_resp(void * pctxt)
{
    LXZAT_ERROR_CODE_E e_err_code = E_LEC_OK;

    sint32 i_req_type = LXZAT_REQ_TYPE_ERR;
    lxzat_req_t * p_cur_req = NULL;
    lxzat_spcfg_t * p_cur_spcfg = NULL;
    lxzdata_info_t * p_cur_datacfg = NULL;
    lxzat_context_t * p_lxzat_ctxt = (lxzat_context_t *)pctxt;

    if (p_lxzat_ctxt == NULL)
    {
        OS_DBG_LOG(("lxzat_dollar_myhwver_resp,p_lxzat_ctxt is NULL!\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }

    p_cur_req = p_lxzat_ctxt->pt_req_data;
    p_cur_spcfg = lxzat_spcomm_f_get(p_lxzat_ctxt->it_vsp_id);
    if ((p_cur_req == NULL) || (p_cur_spcfg == NULL))
    {
        OS_DBG_LOG(("lxzat_dollar_myhwver_resp,p_cur_req or p_cur_spcfg is NULL!\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }

    i_req_type = p_cur_req->it_req_type;
    switch (i_req_type)
    {
    case LXZAT_REQ_TYPE_EXE:
    case LXZAT_REQ_TYPE_READ:
        {
            lxzat_rsp_f_printf(p_lxzat_ctxt->it_vsp_id,
                LXZAT_RSP_MODE_P1N0, 
                "%s: \"%s-%s\"", 
                p_lxzat_ctxt->pt_ai_cfg->pt_ai_keyword,
                LXZAT_HW_NAME,
                LXZAT_HW_VERSION);
            break;
        }
    default:
        {
            e_err_code = E_LEC_ERR_UNSUPPORTED;
            break;
        }
    }
    
    return e_err_code;
}

/*
 *  Description:
 *    The request handler of "AT$MYSWVER".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_myswver_req(void * pctxt)
{
    return E_LEC_OK;
}

/*
 *  Description:
 *    The response handler of "AT$MYSWVER".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_myswver_resp(void * pctxt)
{
    LXZAT_ERROR_CODE_E e_err_code = E_LEC_OK;

    sint32 i_req_type = LXZAT_REQ_TYPE_ERR;
    lxzat_req_t * p_cur_req = NULL;
    lxzat_spcfg_t * p_cur_spcfg = NULL;
    lxzdata_info_t * p_cur_datacfg = NULL;
    lxzat_context_t * p_lxzat_ctxt = (lxzat_context_t *)pctxt;

    if (p_lxzat_ctxt == NULL)
    {
        OS_DBG_LOG(("lxzat_dollar_myswver_resp,p_lxzat_ctxt is NULL!\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }

    p_cur_req = p_lxzat_ctxt->pt_req_data;
    p_cur_spcfg = lxzat_spcomm_f_get(p_lxzat_ctxt->it_vsp_id);
    if ((p_cur_req == NULL) || (p_cur_spcfg == NULL))
    {
        OS_DBG_LOG(("lxzat_dollar_myswver_resp,p_cur_req or p_cur_spcfg is NULL!\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }

    i_req_type = p_cur_req->it_req_type;
    switch (i_req_type)
    {
    case LXZAT_REQ_TYPE_EXE:
    case LXZAT_REQ_TYPE_READ:
        {
            lxzat_rsp_f_printf(p_lxzat_ctxt->it_vsp_id,
                LXZAT_RSP_MODE_P1N0, 
                "%s: \"%s-%s\"", 
                p_lxzat_ctxt->pt_ai_cfg->pt_ai_keyword,
                LXZAT_SW_NAME,
                LXZAT_SW_VERSION);
            break;
        }
    default:
        {
            e_err_code = E_LEC_ERR_UNSUPPORTED;
            break;
        }
    }
    
    return e_err_code;
}

/*
 *  Description:
 *    The request handler of "AT$MYDBGATLIST".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mydbgatlist_req(void * pctxt)
{
    return E_LEC_OK;
}

/*
 *  Description:
 *    The response handler of "AT$MYDBGATLIST".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mydbgatlist_resp(void * pctxt)
{
    LXZAT_ERROR_CODE_E e_err_code = E_LEC_OK;

    sint32 i_req_type = LXZAT_REQ_TYPE_ERR;
    lxzat_req_t * p_cur_req = NULL;
    lxzat_spcfg_t * p_cur_spcfg = NULL;
    lxzdata_info_t * p_cur_datacfg = NULL;
    lxzat_context_t * p_lxzat_ctxt = (lxzat_context_t *)pctxt;

    if (p_lxzat_ctxt == NULL)
    {
        OS_DBG_LOG(("lxzat_dollar_mydbgatlist_resp,p_lxzat_ctxt is NULL!\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }

    p_cur_req = p_lxzat_ctxt->pt_req_data;
    p_cur_spcfg = lxzat_spcomm_f_get(p_lxzat_ctxt->it_vsp_id);
    if ((p_cur_req == NULL) || (p_cur_spcfg == NULL))
    {
        OS_DBG_LOG(("lxzat_dollar_mydbgatlist_resp,p_cur_req or p_cur_spcfg is NULL!\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }

    i_req_type = p_cur_req->it_req_type;
    switch (i_req_type)
    {
    case LXZAT_REQ_TYPE_READ:
        {
            sint32 i = 0;
            lxzat_info_t * p_tmp_aicfg = NULL;

            p_tmp_aicfg = (lxzat_info_t *)lxzat_info_f_get(i);
            while (p_tmp_aicfg != NULL)
            {
                if ((p_tmp_aicfg->it_ai_type & LXZAT_TYPE_RANGE_MASK) == LXZAT_TYPE_RANGE_LOCAL)
                {
                    lxzat_rsp_f_printf(p_lxzat_ctxt->it_vsp_id,
                        LXZAT_RSP_MODE_P1N0, 
                        "%s: %d,\"%s\"", 
                        p_lxzat_ctxt->pt_ai_cfg->pt_ai_keyword,
                        i,
                    p_tmp_aicfg->pt_ai_keyword);
                }
                
                i++;
                p_tmp_aicfg = (lxzat_info_t *)lxzat_info_f_get(i);
            }
            
            break;
        }
    default:
        {
            e_err_code = E_LEC_ERR_UNSUPPORTED;
            break;
        }
    }
    
    return e_err_code;
}

/*
 *  Description:
 *    The initialize handler of "AT$MYSYSTEMCFG".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mysystemcfg_init(void * pctxt)
{
    return E_LEC_OK;
}

/*
 *  Description:
 *    The request handler of "AT$MYSYSTEMCFG".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mysystemcfg_req(void * pctxt)
{
    LXZAT_ERROR_CODE_E e_err_code = E_LEC_OK;
    lxzat_context_t * p_lxzat_ctxt = (lxzat_context_t *)pctxt;
    lxzat_req_t   * p_cur_req = NULL;
    lxzat_spcfg_t * p_cur_spcfg = NULL;
    lxzat_nvcfg_t * p_cur_nvcfg = NULL;

    sint32 i_req_type = LXZAT_REQ_TYPE_ERR;
    sint32 i_cur_startmode = 0;
    sint32 i_new_startmode = 0;

    if (p_lxzat_ctxt == NULL)
    {
        OS_DBG_LOG(("lxzat_dollar_mysystemcfg_req,p_lxzat_ctxt is NULL!\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }

    p_cur_req = p_lxzat_ctxt->pt_req_data;
    p_cur_spcfg = lxzat_spcomm_f_get(p_lxzat_ctxt->it_vsp_id);
    if ((p_cur_req == NULL) || (p_cur_spcfg == NULL))
    {
        OS_DBG_LOG(("lxzat_dollar_mysystemcfg_req,p_cur_req or p_cur_spcfg is NULL!\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }
    p_cur_nvcfg = p_cur_spcfg->pt_nv_cfg;
    if(p_cur_nvcfg == NULL)
    {
        OS_DBG_LOG(("lxzat_dollar_mysystemcfg_req,p_cur_spcfg->pt_nv_cfg is NULL!\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }

    i_req_type = p_cur_req->it_req_type;
    switch (i_req_type)
    {
    case LXZAT_REQ_TYPE_SET:
        {
            if (p_cur_req->it_nb_param != 1)
            {
                OS_DBG_LOG(("lxzat_dollar_mysystemcfg_req,i_nb_param=%d\r\n",p_cur_req->it_nb_param));
                return E_LEC_ERR_P_NB_PARAM;
            }

            if (PARAM1_TYPE(p_cur_req) != LXZAT_PARAM_TYPE_NUMERIC)
            {
                OS_DBG_LOG(("lxzat_dollar_mysystemcfg_req,param1 type error!\r\n"));
                return E_LEC_ERR_P_TYPE;
            }

            i_new_startmode = PARAM1(p_cur_req).it_number;
            if ((i_new_startmode < 0) || (i_new_startmode > 1))
            {
                OS_DBG_LOG(("lxzat_dollar_mysystemcfg_req,i_new_runmode=%d!\r\n", i_new_startmode));
                return E_LEC_ERR_P_RANGE;
            }

            i_cur_startmode = lxzat_startmode_f_get();
            if (i_cur_startmode != i_new_startmode)
            {
#if 0
                char p_tmp_buf[128];

                if (access("/data/myconfig/", F_OK) < 0)
                {
                    system("busybox mkdir -p /data/myconfig/");
                    system("touch /data/myconfig/lstsystem.cfg");
                }
                
                memset(p_tmp_buf, 0, sizeof(p_tmp_buf));
                sprintf(p_tmp_buf, "echo %d > /data/myconfig/lstsystem.cfg", i_new_startmode);
                system(p_tmp_buf);
#endif
                lxzat_startmode_f_set(i_new_startmode);
            }
            break;
        }
    case LXZAT_REQ_TYPE_READ:
        {
            break;
        }
    case LXZAT_REQ_TYPE_TEST:
        {
            break;
        }
    default:
        {
            e_err_code = E_LEC_OK;
            break;
        }
    }

    return e_err_code;
}

/*
 *  Description:
 *    The response handler of "AT$MYSYSTEMCFG".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mysystemcfg_resp(void * pctxt)
{
    sint32 i_err_code = E_LEC_OK;

    sint32 i_req_type = LXZAT_REQ_TYPE_ERR;
    lxzat_req_t * p_cur_req = NULL;
    lxzat_spcfg_t * p_cur_spcfg = NULL;
    lxzat_context_t * p_lxzat_ctxt = (lxzat_context_t *)pctxt;

    if (p_lxzat_ctxt == NULL)
    {
        OS_DBG_LOG(("lxzat_dollar_mysystemcfg_resp,p_lxzat_ctxt is NULL!\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }

    p_cur_req = p_lxzat_ctxt->pt_req_data;
    p_cur_spcfg = lxzat_spcomm_f_get(p_lxzat_ctxt->it_vsp_id);
    if ((p_cur_req == NULL) || (p_cur_spcfg == NULL))
    {
        OS_DBG_LOG(("lxzat_dollar_mysystemcfg_resp,p_cur_req or p_cur_spcfg is NULL!\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }

    i_req_type = p_cur_req->it_req_type;
    switch (i_req_type)
    {
    case LXZAT_REQ_TYPE_SET:
        {
            break;
        }
    case LXZAT_REQ_TYPE_READ:
        {
            sint32 i_cur_startmode = lxzat_startmode_f_get();

            lxzat_rsp_f_printf(p_lxzat_ctxt->it_vsp_id,
                LXZAT_RSP_MODE_P1N0,
                "%s: %d",
                p_lxzat_ctxt->pt_ai_cfg->pt_ai_keyword,
                i_cur_startmode);
            break;
        }
    case LXZAT_REQ_TYPE_TEST:
        {
            lxzat_rsp_f_printf(p_lxzat_ctxt->it_vsp_id,
                LXZAT_RSP_MODE_P1N0,
                "%s: (0,1);/* 0:CSPG;1:SGCC */",
                p_lxzat_ctxt->pt_ai_cfg->pt_ai_keyword);
            break;
        }
    default:
        {
            i_err_code = E_LEC_ERR_UNSUPPORTED;
            break;
        }
    }

    return i_err_code;
}

/*
 *  Description:
 *    The reset handler of "AT$MYSYSTEMCFG".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mysystemcfg_reset(void * pctxt)
{
    return E_LEC_OK;
}

/*
 *  Description:
 *    The initialize handler of "AT$MYTYPEMASK".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mytypemask_init(void * pctxt)
{
    return E_LEC_OK;
}

/*
 *  Description:
 *    The request handler of "AT$MYTYPEMASK".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mytypemask_req(void * pctxt)
{
    LXZAT_ERROR_CODE_E e_err_code = E_LEC_OK;
    lxzat_context_t * p_lxzat_ctxt = (lxzat_context_t *)pctxt;
    lxzat_req_t   * p_cur_req = NULL;
    lxzat_spcfg_t * p_cur_spcfg = NULL;
    lxzat_nvcfg_t * p_cur_nvcfg = NULL;

    sint32 i_req_type = LXZAT_REQ_TYPE_ERR;
    sint32 i_cur_typemask = 0;
    sint32 i_new_typemask = 0;

    if (p_lxzat_ctxt == NULL)
    {
        OS_DBG_LOG(("lxzat_dollar_mytypemask_req,p_lxzat_ctxt is NULL!\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }

    p_cur_req = p_lxzat_ctxt->pt_req_data;
    p_cur_spcfg = lxzat_spcomm_f_get(p_lxzat_ctxt->it_vsp_id);
    if ((p_cur_req == NULL) || (p_cur_spcfg == NULL))
    {
        OS_DBG_LOG(("lxzat_dollar_mytypemask_req,p_cur_req or p_cur_spcfg is NULL!\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }
    p_cur_nvcfg = p_cur_spcfg->pt_nv_cfg;
    if(p_cur_nvcfg == NULL)
    {
        OS_DBG_LOG(("lxzat_dollar_mytypemask_req,p_cur_spcfg->pt_nv_cfg is NULL!\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }

    i_req_type = p_cur_req->it_req_type;
    switch (i_req_type)
    {
    case LXZAT_REQ_TYPE_SET:
        {
            if (p_cur_req->it_nb_param != 1)
            {
                OS_DBG_LOG(("lxzat_dollar_mytypemask_req,i_nb_param=%d\r\n",p_cur_req->it_nb_param));
                return E_LEC_ERR_P_NB_PARAM;
            }

            if (PARAM1_TYPE(p_cur_req) != LXZAT_PARAM_TYPE_NUMERIC)
            {
                OS_DBG_LOG(("lxzat_dollar_mytypemask_req,param1 type error!\r\n"));
                return E_LEC_ERR_P_TYPE;
            }

            i_new_typemask = PARAM1(p_cur_req).it_number;
            i_cur_typemask = lxzat_typemask_f_get();
            if (i_cur_typemask != i_new_typemask)
            {
                switch (i_new_typemask)
                {
                    case 0/* U9501, 4G-5RAT */:
                    {
                        if (access("/data/myconfig/", F_OK) >= 0)
                        {
                            system("busybox rm -f /data/myconfig/mytypemask.cfg");
                        }

                        lxzat_typemask_f_set(LXZAT_DEF_TYPE_MASK);
                        break;
                    }
                    case 1/* Detail: 1:2G-GPRS */:
                    case 5/* Detail: 5:4G-5RAT */:
                    case 7/* Detail: 7:4G-7RAT */:
                    {
                        char p_tmp_buf[128];

                        if (access("/data/myconfig/", F_OK) < 0)
                        {
                            system("busybox mkdir -p /data/myconfig/");
                            system("touch /data/myconfig/mytypemask.cfg");
                        }
                        
                        memset(p_tmp_buf, 0, sizeof(p_tmp_buf));
                        sprintf(p_tmp_buf, "echo %d > /data/myconfig/mytypemask.cfg", i_new_typemask);
                        system(p_tmp_buf);
                        
                        lxzat_typemask_f_set(i_new_typemask);
                        break;
                    }
                    default:
                    {
                        OS_DBG_LOG(("lxzat_dollar_mytypemask_req,i_new_typemask=%d!\r\n", i_new_typemask));
                        e_err_code = E_LEC_ERR_P_RANGE;
                        break;
                    }
                }
            }
            break;
        }
    case LXZAT_REQ_TYPE_READ:
        {
            break;
        }
    case LXZAT_REQ_TYPE_TEST:
        {
            break;
        }
    default:
        {
            e_err_code = E_LEC_OK;
            break;
        }
    }

    return e_err_code;
}

/*
 *  Description:
 *    The response handler of "AT$MYTYPEMASK".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mytypemask_resp(void * pctxt)
{
    sint32 i_err_code = E_LEC_OK;

    sint32 i_req_type = LXZAT_REQ_TYPE_ERR;
    lxzat_req_t * p_cur_req = NULL;
    lxzat_spcfg_t * p_cur_spcfg = NULL;
    lxzat_context_t * p_lxzat_ctxt = (lxzat_context_t *)pctxt;

    if (p_lxzat_ctxt == NULL)
    {
        OS_DBG_LOG(("lxzat_dollar_mytypemask_resp,p_lxzat_ctxt is NULL!\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }

    p_cur_req = p_lxzat_ctxt->pt_req_data;
    p_cur_spcfg = lxzat_spcomm_f_get(p_lxzat_ctxt->it_vsp_id);
    if ((p_cur_req == NULL) || (p_cur_spcfg == NULL))
    {
        OS_DBG_LOG(("lxzat_dollar_mytypemask_resp,p_cur_req or p_cur_spcfg is NULL!\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }

    i_req_type = p_cur_req->it_req_type;
    switch (i_req_type)
    {
    case LXZAT_REQ_TYPE_SET:
        {
            break;
        }
    case LXZAT_REQ_TYPE_READ:
        {
            sint32 i_cur_typemask = lxzat_typemask_f_get();

            lxzat_rsp_f_printf(p_lxzat_ctxt->it_vsp_id,
                LXZAT_RSP_MODE_P1N0,
                "%s: %d",
                p_lxzat_ctxt->pt_ai_cfg->pt_ai_keyword,
                i_cur_typemask);
            break;
        }
    case LXZAT_REQ_TYPE_TEST:
        {
            lxzat_rsp_f_printf(p_lxzat_ctxt->it_vsp_id,
                LXZAT_RSP_MODE_P1N0,
                "%s: (0,1,5,7);/* 0:default;1:2G-GPRS;5:4G-5RAT;7:4G-7RAT */",
                p_lxzat_ctxt->pt_ai_cfg->pt_ai_keyword);
            break;
        }
    default:
        {
            i_err_code = E_LEC_ERR_UNSUPPORTED;
            break;
        }
    }

    return i_err_code;
}

/*
 *  Description:
 *    The reset handler of "AT$MYTYPEMASK".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mytypemask_reset(void * pctxt)
{
    return E_LEC_OK;
}

sint32 lxzat_startmode_f_get(void)
{
    return gs_cur_startmode;
}

sint32 lxzat_startmode_f_set(sint32 i_new_startmode)
{
    sint08 i_op_status = LXZAT_FALSE;

    if ((i_new_startmode == 0) || (i_new_startmode == 1))
    {
        gs_cur_startmode = i_new_startmode;
        i_op_status = LXZAT_TRUE;
    }

    return i_op_status;
}

sint32 lxzat_startmode_f_init(sint32 i_init_startmode)
{
    sint32 i_op_status = 0;

    FILE * fp_cfg_fd = NULL;
    sint32 i_new_startmode = i_init_startmode;

    sint32 i_read_len = 0;
    sint08 p_read_buf[12]; 

    fp_cfg_fd = fopen("/data/myconfig/lstsystem.cfg","rb");
    if(fp_cfg_fd != NULL)
    {
        i_read_len = fread(p_read_buf, 1, sizeof(p_read_buf), fp_cfg_fd);
        if (i_read_len > 0)
        {
            i_new_startmode = atoi(p_read_buf);
        }

        fclose(fp_cfg_fd);
    }
    lxzat_startmode_f_set(i_new_startmode);

    return i_op_status;
}

sint32 lxzat_typemask_f_get(void)
{
    return gs_cur_typemask;
}

sint32 lxzat_typemask_f_set(sint32 i_new_typemask)
{
    sint08 i_op_status = LXZAT_FALSE;

    if ((i_new_typemask == 1) || (i_new_typemask == 5) || (i_new_typemask == 7))
    {
        gs_cur_typemask = i_new_typemask;
        i_op_status = LXZAT_TRUE;
    }

    return i_op_status;
}

sint32 lxzat_typemask_f_init(sint32 i_init_typemask)
{
    sint32 i_op_status = LXZAT_TRUE;

    FILE * fp_cfg_fd = NULL;
    sint32 i_new_typemask = i_init_typemask;

    sint32 i_read_len = 0;
    sint08 p_read_buf[12]; 

    fp_cfg_fd = fopen("/data/myconfig/mytypemask.cfg","rb");
    if(fp_cfg_fd != NULL)
    {
        i_read_len = fread(p_read_buf, 1, sizeof(p_read_buf), fp_cfg_fd);
        if (i_read_len > 0)
        {
            i_new_typemask = atoi(p_read_buf);
        }

        fclose(fp_cfg_fd);
    }
    lxzat_typemask_f_set(i_new_typemask);

    return i_op_status;
}

/*
 *  Description:
 *    The initialize handler of "AT$MYCIMI".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mycimi_init(void * pctxt)
{
    return E_LEC_OK;
}

/*
 *  Description:
 *    The request handler of "AT$MYCIMI".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mycimi_req(void * pctxt)
{
    return E_LEC_OK;
}

/*
 *  Description:
 *    The response handler of "AT$MYCIMI".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mycimi_resp(void * pctxt)
{
    LXZAT_ERROR_CODE_E e_err_code = E_LEC_OK;
    
    sint32 i_req_type = LXZAT_REQ_TYPE_ERR;
    lxzat_req_t * p_cur_req = NULL;
    lxzat_spcfg_t * p_cur_spcfg = NULL;
    lxzat_context_t * p_lxzat_ctxt = (lxzat_context_t *)pctxt;
    
    if (p_lxzat_ctxt == NULL)
    {
        OS_DBG_LOG(("lxzat_dollar_mycimi_resp,p_lxzat_ctxt is NULL\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }
    
    p_cur_req = p_lxzat_ctxt->pt_req_data;
    p_cur_spcfg = lxzat_spcomm_f_get(p_lxzat_ctxt->it_vsp_id);
    if ((p_cur_req == NULL) || (p_cur_spcfg == NULL))
    {
        OS_DBG_LOG(("lxzat_dollar_mycimi_resp,p_cur_req or p_cur_spcfg is NULL\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }
    
    i_req_type = p_cur_req->it_req_type;
    switch (i_req_type)
    {
    case LXZAT_REQ_TYPE_EXE:
    case LXZAT_REQ_TYPE_READ:
        {
            lxzat_rsp_f_printf(p_lxzat_ctxt->it_vsp_id, 
                LXZAT_RSP_MODE_P1N0, 
                "%s: \"%s\"", 
                p_lxzat_ctxt->pt_ai_cfg->pt_ai_keyword,
                "460018621721170");
            break;
        }

    default:
        {
            e_err_code = E_LEC_ERR_UNSUPPORTED;
            break;
        }
    }

    return e_err_code;
}

/*
 *  Description:
 *    The reset handler of "AT$MYCIMI".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mycimi_reset(void * pctxt)
{
    return E_LEC_OK;
}

/*
 *  Description:
 *    The initialize handler of "AT$MYCGSN".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mycgsn_init(void * pctxt)
{
    return E_LEC_OK;
}

/*
 *  Description:
 *    The request handler of "AT$MYCGSN".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mycgsn_req(void * pctxt)
{
    return E_LEC_OK;
}

/*
 *  Description:
 *    The response handler of "AT$MYCGSN".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mycgsn_resp(void * pctxt)
{
    LXZAT_ERROR_CODE_E e_err_code = E_LEC_OK;
    
    sint32 i_req_type = LXZAT_REQ_TYPE_ERR;
    lxzat_req_t * p_cur_req = NULL;
    lxzat_spcfg_t * p_cur_spcfg = NULL;
    lxzat_context_t * p_lxzat_ctxt = (lxzat_context_t *)pctxt;
    
    if (p_lxzat_ctxt == NULL)
    {
        OS_DBG_LOG(("lxzat_dollar_mycgsn_resp,p_lxzat_ctxt is NULL\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }
    
    p_cur_req = p_lxzat_ctxt->pt_req_data;
    p_cur_spcfg = lxzat_spcomm_f_get(p_lxzat_ctxt->it_vsp_id);
    if ((p_cur_req == NULL) || (p_cur_spcfg == NULL))
    {
        OS_DBG_LOG(("lxzat_dollar_mycgsn_resp,p_cur_req or p_cur_spcfg is NULL\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }
    
    i_req_type = p_cur_req->it_req_type;
    switch (i_req_type)
    {
    case LXZAT_REQ_TYPE_EXE:
    case LXZAT_REQ_TYPE_READ:
        {
            lxzat_rsp_f_printf(p_lxzat_ctxt->it_vsp_id, 
                LXZAT_RSP_MODE_P1N0, 
                "%s: \"%s\"", 
                p_lxzat_ctxt->pt_ai_cfg->pt_ai_keyword,
                "6630118621721170");
            break;
        }

    default:
        {
            e_err_code = E_LEC_ERR_UNSUPPORTED;
            break;
        }
    }

    return e_err_code;
}

/*
 *  Description:
 *    The reset handler of "AT$MYCGSN".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mycgsn_reset(void * pctxt)
{
    return E_LEC_OK;
}

/*
 *  Description:
 *    The initialize handler of "AT$MYCGMI".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mycgmi_init(void * pctxt)
{
    return E_LEC_OK;
}

/*
 *  Description:
 *    The request handler of "AT$MYCGMI".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mycgmi_req(void * pctxt)
{
    return E_LEC_OK;
}

/*
 *  Description:
 *    The response handler of "AT$MYCGMI".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mycgmi_resp(void * pctxt)
{
    LXZAT_ERROR_CODE_E e_err_code = E_LEC_OK;
    
    sint32 i_req_type = LXZAT_REQ_TYPE_ERR;
    lxzat_req_t * p_cur_req = NULL;
    lxzat_spcfg_t * p_cur_spcfg = NULL;
    lxzat_context_t * p_lxzat_ctxt = (lxzat_context_t *)pctxt;
    
    if (p_lxzat_ctxt == NULL)
    {
        OS_DBG_LOG(("lxzat_dollar_mycgmi_resp,p_lxzat_ctxt is NULL\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }
    
    p_cur_req = p_lxzat_ctxt->pt_req_data;
    p_cur_spcfg = lxzat_spcomm_f_get(p_lxzat_ctxt->it_vsp_id);
    if ((p_cur_req == NULL) || (p_cur_spcfg == NULL))
    {
        OS_DBG_LOG(("lxzat_dollar_mycgmi_resp,p_cur_req or p_cur_spcfg is NULL\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }
    
    i_req_type = p_cur_req->it_req_type;
    switch (i_req_type)
    {
    case LXZAT_REQ_TYPE_EXE:
    case LXZAT_REQ_TYPE_READ:
        {
            lxzat_rsp_f_printf(p_lxzat_ctxt->it_vsp_id, 
                LXZAT_RSP_MODE_P1N0, 
                "%s: \"%s\"", 
                p_lxzat_ctxt->pt_ai_cfg->pt_ai_keyword,
                "CYCT");
            break;
        }

    default:
        {
            e_err_code = E_LEC_ERR_UNSUPPORTED;
            break;
        }
    }

    return e_err_code;
}

/*
 *  Description:
 *    The reset handler of "AT$MYCGMI".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mycgmi_reset(void * pctxt)
{
    return E_LEC_OK;
}

/*
 *  Description:
 *    The initialize handler of "AT$MYCGMM".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mycgmm_init(void * pctxt)
{
    return E_LEC_OK;
}

/*
 *  Description:
 *    The request handler of "AT$MYCGMM".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mycgmm_req(void * pctxt)
{
    return E_LEC_OK;
}

/*
 *  Description:
 *    The response handler of "AT$MYCGMM".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mycgmm_resp(void * pctxt)
{
    LXZAT_ERROR_CODE_E e_err_code = E_LEC_OK;
    
    sint32 i_req_type = LXZAT_REQ_TYPE_ERR;
    lxzat_req_t * p_cur_req = NULL;
    lxzat_spcfg_t * p_cur_spcfg = NULL;
    lxzat_context_t * p_lxzat_ctxt = (lxzat_context_t *)pctxt;
    
    if (p_lxzat_ctxt == NULL)
    {
        OS_DBG_LOG(("lxzat_dollar_mycgmm_resp,p_lxzat_ctxt is NULL\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }
    
    p_cur_req = p_lxzat_ctxt->pt_req_data;
    p_cur_spcfg = lxzat_spcomm_f_get(p_lxzat_ctxt->it_vsp_id);
    if ((p_cur_req == NULL) || (p_cur_spcfg == NULL))
    {
        OS_DBG_LOG(("lxzat_dollar_mycgmm_resp,p_cur_req or p_cur_spcfg is NULL\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }
    
    i_req_type = p_cur_req->it_req_type;
    switch (i_req_type)
    {
    case LXZAT_REQ_TYPE_EXE:
    case LXZAT_REQ_TYPE_READ:
        {
            lxzat_rsp_f_printf(p_lxzat_ctxt->it_vsp_id, 
                LXZAT_RSP_MODE_P1N0, 
                "%s: \"%s\"", 
                p_lxzat_ctxt->pt_ai_cfg->pt_ai_keyword,
                LXZAT_MDM_MODEL);
            break;
        }

    default:
        {
            e_err_code = E_LEC_ERR_UNSUPPORTED;
            break;
        }
    }

    return e_err_code;
}

/*
 *  Description:
 *    The reset handler of "AT$MYCGMM".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mycgmm_reset(void * pctxt)
{
    return E_LEC_OK;
}

/*
 *  Description:
 *    The initialize handler of "AT$MYCGMR".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mycgmr_init(void * pctxt)
{
    return E_LEC_OK;
}

/*
 *  Description:
 *    The request handler of "AT$MYCGMR".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mycgmr_req(void * pctxt)
{
    return E_LEC_OK;
}

/*
 *  Description:
 *    The response handler of "AT$MYCGMR".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mycgmr_resp(void * pctxt)
{
    LXZAT_ERROR_CODE_E e_err_code = E_LEC_OK;
    
    sint32 i_req_type = LXZAT_REQ_TYPE_ERR;
    lxzat_req_t * p_cur_req = NULL;
    lxzat_spcfg_t * p_cur_spcfg = NULL;
    lxzat_context_t * p_lxzat_ctxt = (lxzat_context_t *)pctxt;
    
    if (p_lxzat_ctxt == NULL)
    {
        OS_DBG_LOG(("lxzat_dollar_mycgmr_resp,p_lxzat_ctxt is NULL\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }
    
    p_cur_req = p_lxzat_ctxt->pt_req_data;
    p_cur_spcfg = lxzat_spcomm_f_get(p_lxzat_ctxt->it_vsp_id);
    if ((p_cur_req == NULL) || (p_cur_spcfg == NULL))
    {
        OS_DBG_LOG(("lxzat_dollar_mycgmr_resp,p_cur_req or p_cur_spcfg is NULL\r\n"));
        return E_LEC_ERR_UNKNOWN;
    }
    
    i_req_type = p_cur_req->it_req_type;
    switch (i_req_type)
    {
    case LXZAT_REQ_TYPE_EXE:
    case LXZAT_REQ_TYPE_READ:
        {
            lxzat_rsp_f_printf(p_lxzat_ctxt->it_vsp_id, 
                LXZAT_RSP_MODE_P1N0, 
                "%s: \"%s\"", 
                p_lxzat_ctxt->pt_ai_cfg->pt_ai_keyword,
                LXZAT_MDM_REVISION);
            break;
        }

    default:
        {
            e_err_code = E_LEC_ERR_UNSUPPORTED;
            break;
        }
    }

    return e_err_code;
}

/*
 *  Description:
 *    The reset handler of "AT$MYCGMR".
 *  Param: pctxt, the pointer of AT command context;
 *  Return: Operating results;
 *  Note: NONE
 */
static sint32 lxzat_dollar_mycgmr_reset(void * pctxt)
{
    return E_LEC_OK;
}
